/*
 * Project Name spring-boot-tools
 * File Name CallBackTask
 * Package Name com.huxiaosu.tools.quartz.task
 * Create Time 2024/7/29
 * Create by name：liujie
 */
package com.huxiaosu.tools.quartz.task;

import com.huxiaosu.tools.quartz.entity.JobDetails;
import com.huxiaosu.tools.quartz.entity.JobLog;
import com.huxiaosu.tools.quartz.mapper.JobLogMapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * Description
 *
 * @author liujie
 * @date 2024/7/29 14:58
 */
@Slf4j
@AllArgsConstructor
public class CallBackTask implements Runnable{
    private JobDetails jobDetails;
    private JobLogMapper jobLogMapper;
    @Override
    public void run() {
        log.info("taskName = [{}]  start ... ",this.jobDetails.getJobName());
        JobLog jobLog = new JobLog();
        jobLog.setJobId(jobDetails.getId());
        jobLogMapper.insert(jobLog);
    }
}